package com.robcity.platform.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description
 * @Author zhangsong
 * @Date 2024/8/9
 **/
@Getter
@AllArgsConstructor
public enum WorkStatusEnum {
    WORKING(1, "执行中"),

    FINISHED(2, "已完成");

    private final Integer code;

    private final String desc;

    public static WorkStatusEnum getByCode(Integer code) {
        for (WorkStatusEnum workStatusEnum : WorkStatusEnum.values()) {
            if (workStatusEnum.getCode().equals(code)) {
                return workStatusEnum;
            }
        }
        return null;
    }
}
